﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Contact Editor</title>

    <!-- CRM2013 Styles -->
    <link href="../../sparkle_/css/2013/sparkle_jquery_ui.css" rel="stylesheet" />
    <link href="../../sparkle_/css/2013/sparkle.css" rel="stylesheet" />
    <!-- CRM2011 Styles -->
    <!--<link href="../../sparkle_/css/sparkle_jquery_ui.css" rel="stylesheet" />
    <link href="../../sparkle_/css/sparkle.css" rel="stylesheet" />-->

    <style>
        #container {
            padding-top: 0px;
            padding-left: 0px;
            padding-right: 2px;
            padding-bottom: 2px;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            height: 300px;
        }

     
        #contactsGrid {
            margin-left: 30px;
            margin-right: 30px;
        }
    </style>
</head>
<body class="sparkle-xrm">

    <!--ko template: { name: 'xrmPleaseWaitBlock', data: {isBusy : isBusy, isBusyProgress : isBusyProgress, isBusyMessage : isBusyMessage}} --><!--/ko-->

    <!-- Contact Editor Grid-->
    <div id="contactsEditorGrid">
        <span id="toolbar" class="sparkle-gridtoolbar">
            <button id="save" data-bind="click: saveCommand(), disable: isBusy()" class="gridtoolbar-button save16">Save</button>
            <button id="reset" data-bind="click: resetCommand(), disable: isBusy()" class="gridtoolbar-button reset16">Reset</button>
        </span>
        <div id="container"></div>
        <div id="pager"></div>
    </div>
     
    <!-- Contact Editor Form-->
   <div  data-bind='validationOptions: { messageTemplate: "xrmControlValidationMessage" }' >
     <div data-bind="template: { name: 'sparkle-form-tab-header', data: { title: 'Edit Contact' } }"></div>
        
       <div data-bind='with: selectedContact'> 
                    <table class="sparkle-FormSection"
                        columns="2" label="General" style="table-layout: fixed;" height="1%" valign="top"
                        cellspacing="0" cellpadding="3">
                        <colgroup>
                            <col width="130">
                            <col>
                        </colgroup>
                        <tbody>
                            <tr height="5">
                                <td></td>
                                <td></td>
                            </tr>
                            <tr valign="top">
                                <!--ko template: { name: 'sparkle-form-field', data: { label: 'First Name',field:firstname,required:0,type:'text',disable:false,visible:true } }-->
                                <!--/ko-->
                            </tr>
                            <tr valign="top">
                                <!--ko template: { name: 'sparkle-form-field', data: { label: 'Last Name',field:lastname,required:2,type:'text',disable:false,visible:true } }-->
                                <!--/ko-->
                            </tr>
                             <tr valign="top">
                                <!--ko template: { name: 'sparkle-form-field', data: { label: 'Birth Date',field:birthdate,required:0,type:'datetime',disable:false,visible:true } }-->
                                <!--/ko-->
                            </tr>
                             <tr valign="top">
                                <!--ko template: { name: 'sparkle-form-field', data: { label: 'Account Role',field:accountrolecode,required:2,type:'optionset',entityLogicalName:'contact',attributeLogicalName:'accountrolecode',disable:false,visible:true,allowEmpty:true } }-->
                                <!--/ko-->
                            </tr>
                              <tr valign="top">
                                <!--ko template: { name: 'sparkle-form-field', data: { label: 'Number of Children',field:numberofchildren,required:0,type:'numeric',disable:false,visible:true,minvalue:0,maxvalue:100,precision:0 } }-->
                                <!--/ko-->
                            </tr>
                            <tr valign="top">
                                <!--ko template: { name: 'sparkle-form-field', data: { label: 'Currency',field:transactioncurrencyid,required:0,type:'lookup',disable:false,visible:true,queryCommand: $root.transactionCurrencySearchCommand,type:'lookup',typeCodeAttribute: '', idAttribute:'transactioncurrencyid',nameAttribute:'currencyname' } }-->
                                <!--/ko-->
                            </tr>
                             <tr valign="top">
                                <!--ko template: { name: 'sparkle-form-field', data: { label: 'Credit Limit',field:creditlimit,required:0,type:'money',disable:false,visible:true,minvalue:0,maxvalue:100000000 } }-->
                                <!--/ko-->
                            </tr>
                        </table>
          
            </div>
        <button class="dialogButton" data-bind="click: saveSelectedContact(), enable: selectedContact.isValid">Apply</button>
        <button class="dialogButton" data-bind="click: addNewContact(), enable: canAddNew()">Add New</button>
   </div>


    <!-- Start of Scripts-->
    <script src="../../ClientGlobalContext.js.aspx" type="text/javascript"></script>
     <script>
         window.APPLICATION_VERSION = '6.0';
    </script>
    <!-- Sparkle Xrm dependancies -->
    <script src="../../sparkle_/js/SparkleXrmUI_Dependancies.js"></script>
    <!-- Uncomment the following and comment about the script above to debug the individual dependancies-->
    <!--
    <script src="../../sparkle_/dependancies/SparkleXrm-jquery.js" type="text/javascript"></script>
    <script src="../../sparkle_/dependancies/jquery.event.drag.js" type="text/javascript"></script>
    <script src="../../sparkle_/dependancies/blockUI.js" type="text/javascript"></script>
    <script src="../../sparkle_/dependancies/slick.core.js" type="text/javascript"></script>
    <script src="../../sparkle_/dependancies/slick.grid.js" type="text/javascript"></script>
    <script src="../../sparkle_/dependancies/slick.rowselectionmodel.js" type="text/javascript"></script>
    <script src="../../sparkle_/dependancies/slick.checkboxselectcolumn.js" type="text/javascript"></script>
    <script src="../../sparkle_/dependancies/slick.pager.js" type="text/javascript"></script>
    <script src="../../sparkle_/dependancies/slick.editors.js" type="text/javascript"></script>
    <script src="../../sparkle_/dependancies/knockout.debug.js" type="text/javascript"></script>
    <script src="../../sparkle_/dependancies/knockout.validation.debug.js" type="text/javascript"></script>-->
    

    <!-- Sparkle Xrm -->
    <script src="../../sparkle_/js/mscorlib.js" type="text/javascript"></script>
    <script src="../../sparkle_/js/SparkleXrm.js" type="text/javascript"></script>
    <script src="../../sparkle_/js/SparkleXrmUI.js" type="text/javascript"></script>

   

    <!-- Client Code -->
    <script src="../js/Client.js" type="text/javascript"></script>
    <script type="text/javascript">

            Client.Views.ContactEditorView.init();

    </script>
</body>
</html>
